﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace Inbox.Domain
{
    [Table(Name = "dbo.Planning")]
    public class Planning 
    {

        #region Private
        protected Guid _ID;
        protected bool _deleted;
        protected string _createUser;
        protected DateTime _createDate;
        protected Binary _timeStamp;
        private bool? _Aprroved;
        private int? _Type;
        private int? _Status;
        private DateTime?
            _StartDate,
            _EndDate;

        private string _Description,
                           _Title,
                           _ResponsiblePerson;

        //private EntitySet<Machine_Planning> _Machine_Planning;

        #endregion

        [Column(Name = "ID", Storage = "_ID", DbType = "UniqueIdentifier NOT NULL", IsPrimaryKey = true, UpdateCheck = UpdateCheck.Never)]
        public  Guid ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this._ID = value;
            }
        }

        [Column(Storage = "_deleted", DbType = "Bit", UpdateCheck = UpdateCheck.Never)]
        public  bool Deleted
        {
            get
            {
                return this._deleted;
            }
            set
            {
                this._deleted = value;
            }
        }

        [Column(Storage = "_createUser", DbType = "NVarChar(50)", UpdateCheck = UpdateCheck.Never)]
        public  string CreateUser
        {
            get
            {
                return this._createUser;
            }
            set
            {
                this._createUser = value;
            }
        }

        [Column(Storage = "_createDate", DbType = "DateTime", UpdateCheck = UpdateCheck.Never)]
        public  DateTime CreateDate
        {
            get
            {
                return this._createDate;
            }
            set
            {
                this._createDate = value;
            }
        }

        [Column(Storage = "_timeStamp", AutoSync = AutoSync.Always, DbType = "rowversion", IsDbGenerated = true, IsVersion = true, UpdateCheck = UpdateCheck.Never)]
        public  System.Data.Linq.Binary TimeStamp
        {
            get
            {
                return this._timeStamp;
            }
        }

        [Column(Storage = "_Type", DbType = "Int", UpdateCheck = UpdateCheck.Never)]
        public int? Type
        {
            get
            {
                return this._Type;
            }
            set
            {
                this._Type = value;
            }
        }

        [Column(Storage = "_Status", DbType = "Int", UpdateCheck = UpdateCheck.Never)]
        public int? Status
        {
            get
            {
                return this._Status;
            }
            set
            {
                this._Status = value;
            }
        }

        [Column(Storage = "_StartDate", DbType = "Date", UpdateCheck = UpdateCheck.Never)]
        public DateTime? StartDate
        {
            get
            {
                return this._StartDate;
            }
            set
            {
                this._StartDate = value;
            }
        }

        [Column(Storage = "_EndDate", DbType = "Date", UpdateCheck = UpdateCheck.Never)]
        public DateTime? EndDate
        {
            get { return this._EndDate; }
            set { this._EndDate = value; }
        }

        [Column(Storage = "_Aprroved", DbType = "Bit", UpdateCheck = UpdateCheck.Never)]
        public bool? Aprroved
        {
            get { return this._Aprroved; }
            set { this._Aprroved = value; }
        }

        [Column(Name="ResponsiblePerson", Storage = "_ResponsiblePerson", DbType = "NVarChar(500)", UpdateCheck = UpdateCheck.Never)]
        public string ResposiblePerson
        {
            get { return this._ResponsiblePerson; }
            set { this._ResponsiblePerson = value; }
        }

        [Column(Storage = "_Title", DbType = "NVarChar(2000)", UpdateCheck = UpdateCheck.Never)]
        public string Title
        {
            get { return this._Title; }
            set { this._Title = value; }
        }

        [Column(Storage = "_Description", DbType = "NVarChar(4000)", UpdateCheck = UpdateCheck.Never)]
        public string Description
        {
            get { return this._Description; }
            set { this._Description = value; }
        }

        //[Association(Name = "Planning_Machine_Planning", Storage = "_Machine_Planning", ThisKey = "ID", OtherKey = "Planning_ID")]
        //public EntitySet<Machine_Planning> Machine_Planning
        //{
        //    get
        //    {
        //        return this._Machine_Planning;
        //    }
        //    set
        //    {
        //        this._Machine_Planning.Assign(value);
        //    }
        //}

        public Planning()
        {
            //this._Machine_Planning = new EntitySet<Machine_Planning>();
        }
    }
}
